//
//  lunBoView.m
//  Tour
//
//  Created by 才诗琦 on 16/3/11.
//  Copyright © 2016年 张中烨. All rights reserved.
//

#import "lunBoView.h"

@implementation lunBoView
- (instancetype)initWithFrame:(CGRect)frame str:(NSString *)str1 str2:(NSString *)str2 str3:(NSString *)str3 arr:(NSMutableArray *)photos
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
           
//            NSMutableArray *photo = result[@"data"][@"photos"];
        
            if (photos.count > 3) {
                CarouselPicture *image = [[CarouselPicture alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH  , 200) timeInterval:2 imageUrlArr:photos urlArr:nil];
                
                [self addSubview:image];}
            else if (photos.count == 0){
                UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)];
                image.image = [UIImage imageNamed:@"changeImage.jpeg"];
            }else{
                // 图片数少于3张 header只显示一张图片
                UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)];
                [image sd_setImageWithURL:[NSURL URLWithString:photos[0]]];
                [self addSubview:image];
            }
            // 轮播图图片数组
         
            //  国家 中文名字
            BaseLabel *cnname = [[BaseLabel alloc] initWithFrame:CGRectMake(30, 100, SCREEN_WIDTH, 20)];
            cnname.text = str1;
            cnname.textColor = [UIColor whiteColor];
            [self addSubview:cnname];
            //  国家 英文名字
            BaseLabel *enname = [[BaseLabel alloc] initWithFrame:CGRectMake(30, 120, SCREEN_WIDTH, 30)];
            enname.text = str2;
            enname.textColor = [UIColor whiteColor];
            [self addSubview:enname];
            // 国家 简单介绍
            BaseLabel *title = [[BaseLabel alloc]initWithFrame:CGRectMake(30, 150, SCREEN_WIDTH - 60, 40)];
            title.text = str3;
            title.numberOfLines = 2;
            title.font = [UIFont systemFontOfSize:15];
            title.textColor = [UIColor whiteColor];
            [self addSubview:title];
       

    }
    
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
